package com.zyy.meetObject3;

public class USBTest {
    public static void main(String[] args) {
        computer Computer = new computer();
        printer Printer = new printer();
        Computer.transferDate(Printer);
    }
}
class computer{
    public void transferDate(USB usb){
        System.out.println("设备连接成功....");
        usb.start();
        System.out.println("设备运行中....");
        usb.stop();
        System.out.println("设备运行完毕....");
    }
}
class printer implements USB{

    @Override
    public void start() {
        System.out.println("打印机开始工作...");
    }

    @Override
    public void stop() {
        System.out.println("打印机结束工作...");
    }
}
interface USB{
    //声明常量
    public abstract void start();
    void stop();
}
